<?php
namespace Home\Controller;
use Think\Controller;
use Think\Model;
class IndexController extends Controller {
    public function index(){
        $list = M('user')->select();
        print_r($list);
        $this->assign('list', $list);
        $this->display('index');
    }
    
    public function add() {
        $data = array();
        if (IS_POST) {
                $data['user_name'] = I('post.user_name');
                $data['user_sex'] = I('post.user_sex');
                 $m_user = M('User_msg');
                $result = $m_user->add($data);
                print_r($result);
            }
    	$this->display();
    }


}